<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        table {border-collapse: collapse; font-size: 14px; width: 80%; margin: auto}
        table, th, td {border: 1px solid darkslategray;padding: 10px}
    </style>
</head>
<body>

<span style="color: darkslategray; font-size: 30px">欢迎光临！</span>

<a th:href="@{/users/toAdd}">新增</a>
<hr/>
<table class="list">
    <tr>
        <th>id</th>
        <th>姓名</th>
        <th>密码</th>
        <th>用户类型</th>
        <th>角色ID</th>
        <th>描述信息</th>
        <th>创建时间</th>
        <th>操作</th>
    </tr>
    <tr th:each="user : ${userList}">
        <td th:text="${user.userId}"></td>
        <td th:text="${user.userName}"></td>
        <td th:text="${user.password}"></td>
        <td th:text="${user.userType==0}?'管理员':'普通用户'"></td>
        <td th:text="${user.roleId}"></td>
        <td th:text="${user.userDescription}"></td>
        <td th:text="${#dates.format(user.inputDate,'yyyy-MM-dd')}"></td>
        <td>
            <a th:href="@{/users/findById(userId=${user.userId})}">修改</a>
            <a th:href="@{/users/deleById(userId=${user.userId})}">删除</a>
        </td>
    </tr>
</table>


</body>
</html>